package cn.usian.ceshi;

import org.junit.Test;

public class a {
    //1.字符串的反转
    public static void main1(String[] args) {
        String str = "zxcvb";
        String a = "";
        for (int i = 0; i < str.length(); i++) {
            a = a + str.charAt(str.length() - 1 - i);//charAt取一段字符串中的一个字符
        }
        System.out.println(a);
    }


    @Test
    public static void main(String[] args) {
        int [] v={2,4,7,1,6};
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = 0; i < v.length; i++) {
            stringBuffer.append(v[i]+",");
        }
        System.out.println(stringBuffer);
    }
}
